package com.power.sifa.approve.model.doc;

import cn.hutool.core.util.ObjectUtil;
import com.power.sifa.approve.model.enumeration.Tp_procmaterial;
import lombok.Data;


/**
 * @ClassName HearAuditRestoreDoc
 * @Author xiongzw
 * @Date 2023/11/24 16:32
 * @Description 恢复审理通知书
 * @Version: 1.0
 **/
@Data
public class HearAuditRestoreDoc  extends AbstractDoc {

    /**
     * 申请人
     */
    private String apl_admreview_applyname;
    /**
     * 正文
     */
    private String content;

    /**
     * 抄送
     */
    private String copyto;

    public HearAuditRestoreDoc() {
        super();
        this.setDocType(Tp_procmaterial.HEAR_RESTORE);
    }

    public HearAuditRestoreDoc(String applyid) {
        super(applyid);
        this.setDocType(Tp_procmaterial.HEAR_RESTORE);
    }

    public HearAuditRestoreDoc(String applyid, String apl_admreview_applyname, String content, String copyto) {
        super(applyid);
        this.setDocType(Tp_procmaterial.HEAR_RESTORE);
        this.apl_admreview_applyname = apl_admreview_applyname;
        this.content = content;
        this.copyto = copyto;
    }

    private final static String TEMPLATE = "    {pronoun}对{apl_admreview_targetname}[{behavior}]不服提出的行政复议申请，本府依法已予受理。因（中止审理的事由，本府于{today}中止本案审理。现行政复议中止的原因已消除，根据《中华人民共和国行政复议法实施条例》第四十一条第二款的规定，从即日起恢复该行政复议案件的审理。";



    @Override
    public AbstractDoc generateTemplate(String applyid) {
        HearAuditDelayDoc template = new HearAuditDelayDoc(applyid);
        // 案号
        template.setApl_admre_audit_code(this.getApl_admre_audit_code());
        template.setApl_admreview_applyname(ObjectUtil.isNotNull(this.getAdmreObj()) ? this.getAdmreObj().getApplyname() : "");
        String content = TEMPLATE.replace("{apl_admreview_targetname}", ObjectUtil.isNotNull(this.getAdmreObj()) ?
                this.getAdmreObj().getTargetname() : "" );
        content = content.replace("{behavior}", this.transBehavior());
        content = content.replace("{pronoun}", this.transPronoun());
        content = content.replace("{today}", this.transModelToday(Boolean.FALSE));
        template.setContent(content);
        template.setCopyto("（其他当事人）");
        return template;
    }
}
